﻿<script type="text/javascript">

    $(document).ready(function () {
        var text = "Geef hier uw " + trim(document.getElementById('Type_log').value) + "...";
        var text_logUser = "Wie heeft dit gezegd?";

        $("#message").focus(function () {
            $(this).addClass("active");
            if ($(this).attr("value") == text) $(this).attr("value", "");
        });

        $("#message").blur(function () {
            $(this).removeClass("active");
            if ($(this).attr("value") == "") $(this).attr("value", text);
        });

        $("#logUser").focus(function () {
            $(this).addClass("active");
            if ($(this).attr("value") == text_logUser) $(this).attr("value", "");
        });

        $("#logUser").blur(function () {
            $(this).removeClass("active");
            if ($(this).attr("value") == "") $(this).attr("value", text_logUser);
        });
    });
</script>


<div style="background-color:#DDDDDD; padding-top:10px; padding-bottom:10px; padding-left:10px;">

@{
    List<ViVa.ActiveDirectory.Logging> logList = ViewBag.LogList;

    using (Html.BeginForm("makeLog", "Log"))
    {
        @Html.Hidden("Type_ID", logList.FirstOrDefault().Type_ID)
        @Html.Hidden("Type_log", logList.FirstOrDefault().Type_log)
        <table style="width: 100%;">
        <tr>
            @if (logList.FirstOrDefault().Custom_wie)
            {
            <td style="width: 10%;">
                @Html.TextBox("logUser", "Wie heeft dit gezegd?", new { @autocomplete = "off", @class = "searchbar", @maxlength = 50 })
            </td> 
            }
            <td style="width: 90%;">   
                @Html.TextBox("message", "Geef hier uw " + logList.FirstOrDefault().Type_log + "...", new { @autocomplete = "off", @style = "width:80%", @class = "searchbar", @maxlength = 300 }) <button type="submit" id="savebtn" > Voeg toe... </button>
            </td>
        </tr>
        </table>
    }
}



<table class="form_table" style="color: Gray ">
@*Laat de laatste vijf changes zien:*@
@if (ViewBag.Title == "Admin page")
{ 
    
    <tr>
        <th>Wanneer</th>
        <th>Wie</th>
        <th>Wat</th>
    </tr>
    foreach (ViVa.ActiveDirectory.Logging log in logList)
    {
         <tr>
         <td>@log.Wanneer</td>
         <td>@log.Wie</td>
         <td>@log.Wat</td>
         </tr>
         }
    
    }
  </table>                                                             
</div>